 Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. 

Oracle Multimedia Java API Sample Application
---------------------------------------------

 This sample application has been provided to help developers
 learn how to use Oracle Multimedia Java API. The sample application
 is one of the examples on Oracle Database Examples media which is
 available for download from Oracle Technology Network. The sample code 
 uses the Sample Schema to demonstrates how to upload, download, update,
 and delete Oracle Multimedia objects, including image, audio, and video. 
 It also demonstrates how to extract attributes from media content, 
 generate thumbnail images, and display media.

 Requirements for the sample application:

 Install Oracle Database with Oracle Multimedia.  

 Step 1: Grant appropriate permissions to the user you will use to 
         connect to the database

         For example, if you connect using the user "SCOTT": 

           - connect to the database as sysdba
           - grant all on pm.online_media to scott;
           - grant select on oe.product_information to scott;
           - grant read on directory MEDIA_DIR to scott;

         Note: The schema PM and OE belong to the Sample Schema. 
               If PM and OE do not exist, install the Sample Schema 
               first before continuing.

 Step 2: Compile and start the sample application

    Option A: Use provided perl scripts to compile and start if
      perl is supported
      
      o Compile the sample application:

        From the command line, type:  
              perl compile.pl

      o Start the sample application:

        From the command line, type:  
              perl run.pl

        Note : Be sure the location of the JDBC OCI shared library is 
               specified in LD_LIBRARY_PATH (for UNIX) or PATH (for 
               Windows). Note that this library path may already be 
               specified since the same shared library path must be 
               specified to use other client applications such as 
               SQL*Plus.

               Unix:
                 <ORACLE_HOME>/lib (for libocijdbc12.so)
               Windows:
                 <ORACLE_HOME>\bin (for ocijdbc12.dll)

    Option B: Manually compile and start the sample 
              application

        Ensure that the Java environment is correct and set up to 
        compile and run Java programs.

      o Confirm that the CLASSPATH environment variable includes the
        following Oracle Multimedia and Oracle Java libraries, in addition to
        any libraries that may be required by the JDK you are using:

        Unix:
          JDK 6 or later:
            <ORACLE_HOME>/ord/jlib/ordim.jar
            <ORACLE_HOME>/jdbc/lib/ojdbc6.jar
            <ORACLE_HOME>/jlib/orai18n.jar (optional, see note 1)
            <ORACLE_HOME>/lib/xmlparserv2.jar
            <ORACLE_HOME>/rdbms/jlib/xdb.jar
            <ORACLE_HOME>/ord/im/demo/java/conf
            <ORACLE_HOME>/ord/im/demo/java/icons


        Windows:
          JDK 6 or later:
            <ORACLE_HOME>\ord\jlib\ordim.jar
            <ORACLE_HOME>\jdbc\lib\ojdbc6.jar
            <ORACLE_HOME>\jlib\orai18n.jar (optional, see note 1)
            <ORACLE_HOME>\lib\xmlparserv2.jar
            <ORACLE_HOME>\rdbms\jlib\xdb.jar
            <ORACLE_HOME>\ord\im\demo\java\conf
            <ORACLE_HOME>\ord\im\demo\java\icons


        Note 1: You must include orai18n.jar in the CLASSPATH 
                variable if NLS character set conversion is required 
                between the client application and the database 
                server.  See "Oracle Database JDBC Developer's Guide 
                and Reference" for more information on NLS character 
                set conversion.  If NLS character set conversion is 
                required, but the appropriate library is not specified,
                then character-based attributes of Oracle Multimedia object 
                types may be returned as hex-encoded strings.

        Note 2: Be sure the location of the JDBC OCI shared library is 
                specified in LD_LIBRARY_PATH (for UNIX) or PATH (for 
                Windows). Note that this library path may already be 
                specified since the same shared library path must be 
                specified to use other client applications such as 
                SQL*Plus.

                Unix:
                  <ORACLE_HOME>/lib (for libocijdbc12.so)
                Windows:
                  <ORACLE_HOME>\bin (for ocijdbc12.dll)

      o Compile the sample application

         From the command line, type:
              javac *.java

      o Start the sample application

         From the command line, type:  
              java IMExample
       
 Step 4: Login and run

        The application will present you with a login screen. Enter 
        your username and password, along with the host name, port 
        number and service name you wish to connect to.

        After connecting, the application will display the product_id, 
        product_name and product_description columns of the 
        product_information table in the Sample Schema.

        Click on the "CHECK_MEDIA" column to display, upload, download,
        update or delete multimedia data associated with the product.

